from selenium.webdriver.common.by import By


import time

from selenium import webdriver

# 创建浏览器驱动对象
driver = webdriver.Edge()
# 打开页面
driver.get("https://www.baidu.com/")
ele_file=driver.find_element(By.CSS_SELECTOR, "") #定位文件上传元素
ele_file.click()
time.sleep(5) #暂停5秒人，让文件上传窗口打开
from pywinauto.keyboard import send_keys
#输入文件绝对路径
send_keys(r"E:\Desktop\1111.jpg")  # send_keys 来自于pywinauto这个库
# 输入回车键
send_keys('{ENTER}')



time.sleep(10)

driver.quit()